﻿using System;
using System.Windows.Forms;

namespace YArchitech.Controls
{
	public class DataGridViewGroupColumn : DataGridViewTextBoxColumn
	{
		public DataGridViewGroupColumn()
		{
			this.CellTemplate = new DataGridViewGroupCell();
			this.ReadOnly = true;
		}

		public override DataGridViewCell CellTemplate
		{
			get
			{
				return base.CellTemplate;
			}
			set
			{
				if (value != null && !(value is DataGridViewGroupCell))
				{
					throw new InvalidCastException("Need System.Windows.Forms.DataGridViewGroupCell");
				}
				base.CellTemplate = value;
			}
		}
	}
}
